package com.itheima.tanhua.server.controller;

import com.itheima.tanhua.po.RecommendationPo;
import com.itheima.tanhua.server.service.TanhuaService;
import com.itheima.tanhua.vo.TodayBestVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author itheima
 * @since 2022-01-14
 */
@RestController
@RequestMapping("tanhua")
public class TanhuaController {

    @Autowired
    private TanhuaService tanhuaService;


    /**
     * Day03 今日佳人
     * 随机获取同城市用户
     *
     * @return ResponseEntity
     */
    @GetMapping("todayBest")
    public ResponseEntity todayBest() {
        TodayBestVo todayBest = tanhuaService.getTodayBest();
        return ResponseEntity.ok(todayBest);
    }

    /**
     * Day04
     *
     * @param id
     * @return
     */
    @GetMapping("{id}/personalInfo")
    public ResponseEntity personalInfo(@PathVariable String id) {
        return ResponseEntity.ok(null);
    }

    /**
     * Day04 获取首页推荐用户列表
     *
     * @return
     */
    @GetMapping("/recommendation")
    public ResponseEntity getRecommendationList(RecommendationPo recommendationPo) {
        return ResponseEntity.ok(tanhuaService.getRecommendationList(recommendationPo));
    }
}
